﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DB_NH.DB_Map.ywxt.ProjectBuyRecord
{
    using NHibernate;
    using NHibernate.Mapping.ByCode;
    using NHibernate.Mapping.ByCode.Conformist;

    using DB_NH.DB_Model.ywxt.ProjectBuyRecord;

    class ProjectFinanceRecord_Map : ClassMapping<ProjectFinanceRecord>
    {
        public ProjectFinanceRecord_Map()
        {
            //映射ID
            Id(x => x.rec_id, map => map.Length(40));

            Property(x => x.is_valid);
            Property(x => x.create_date);

            
            //操作用户
            ManyToOne(x => x.OpUser, map =>
            {
                map.Column("op_user_id");
            });

            //所属项目
            ManyToOne(x => x.Project, map =>
            {
                map.Column("proj_id");
            });

            Property(x => x.rec_describe, map => map.Length(40));

            Property(x => x.rec_flag);

            Property(x => x.rec_from_id, map => map.Length(40));

            Property(x => x.rec_pjhm, map => map.Length(200));

            Property(x => x.rec_pzhm, map => map.Length(200));

            Property(x => x.rec_type, map => map.Length(50));

            Property(x => x.rec_type_id, map => map.Length(50));

            Property(x => x.rec_value);

            Table("t_project_finance_record");

            //不进行创建
            SchemaAction(NHibernate.Mapping.ByCode.SchemaAction.None);
        }
    }
}
